package com.tengju.bff.interfaces.covercharge.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.tengju.bff.interfaces.covercharge.entity.po.CustPaidTrans;
import com.tengju.bff.interfaces.covercharge.entity.po.ServiceSelfCertificationWithdraw;
import com.tengju.bff.interfaces.covercharge.entity.vo.*;
import org.springframework.transaction.annotation.Transactional;

import java.math.BigDecimal;
import java.util.List;

/**
 * <p>
 * 自认证用户提现表 服务类
 * </p>
 *
 * @author zhaoyi
 * @since 2020-02-26
 */
public interface IServiceSelfCertificationWithdrawService extends IService<ServiceSelfCertificationWithdraw> {

    /**
     * App端获取自认证申请记录
     * @param idCode 用户Id
     * @param platformCode 平台编号
     * @param type 审批类型
     * @param dateTime 时间
     * @return
     */
    List<WithdrawRecordVo> getWithdrawList(Integer idCode, String platformCode, Integer type, String dateTime);

    /**
     * app端获取已发金额
     * @param idCode 用户ID
     * @param platformCode 平台编号
     * @param type 审批类型
     * @param dateTime 时间
     * @return
     */
    BigDecimal getIssuedAmount(Integer idCode, String platformCode, Integer type, String dateTime);

    /**
     * app端获取待发金额
     * @param idCode 用户ID
     * @param platformCode 平台编号
     * @param type 审批类型
     * @param dateTime 时间
     * @return
     */
    BigDecimal getBeIssuedAmount(Integer idCode, String platformCode, Integer type, String dateTime);

    Page<AdminSelfCertificationQueryVo> queryPageCertification(Page page, String idCode, String name, Integer invoice, String platform, Integer status, String startDate, String endDate, Integer type, String exportType);

    /**
     * App端获取自认证申请记录
     * @param idCode 用户Id
     * @param platformCode 平台编号
     * @param type 审批类型
     * @param startTime 申请开始时间
     * @return
     */
    List<AdminSelfCertificationQueryVo> withdrawListByTime(Integer idCode, String platformCode, Integer type, String startTime,String endTime);

    /**
     *是否存在自认证提现
     *
     * 状态不等于5-终止
     * @param idCode
     * @return
     */
    Boolean isExistSelfCertWithdraw(Long idCode);

    @Transactional(rollbackFor = Exception.class)
    CashBackRes doWithdraw(Integer id, String adminNickName, Boolean isAll);

//    @Transactional(rollbackFor = Exception.class)
//    CashBackRes certificationModelResultsNotice(TransferResponse transferResponse);

    IPage<AdminSelfCertificationQueryVo> queryPageCertificationPaid(Page<Object> objectPage, String codeId, String name, Integer invoice, String platformCode, Integer status, String startDate, String endDate, Integer type);

    PlayWithConfirmationPreviewVo getTotalAmountWithList(List<Integer> cycleAddIdList);

    PlayWithConfirmationPreviewVo getTotalAmountWithAll();

    List<ServiceSelfCertificationWithdraw> queryPaidBatchList(List<Integer> cycleAddIds);

    String batchProcessingWithdrawalRecordPaid(List<ServiceSelfCertificationWithdraw> serviceSelfCertificationWithdrawList, String approvers);

    String allProcessingWithdrawalRecordPaid(String approvers);

    CashBackRes doWithdrawalResultsQuery(CustPaidTrans custPaidTrans);

    Integer getRunningBatchCount();

    String individualTreatment(AdminSinceCertificationIndividualProcessVo adminSinceCertificationIndividualProcessVo);

    List<SinceCertificationPrintApplicationFormVo> printApplicationForm(List<AdminSelfCertificationQueryVo> list);

    <T> IPage<AdminSelfCertificationQueryVo> queryPageCertificationPaid(Page<T> tPage, String codeId, String name, Integer invoice, String platformCode, Integer status, String startDate, String endDate, Integer type, String id);

    AdminSelfCertificationMoneyTotalVo queryCertificationPaidMoneyTotal(String codeId, String name, Integer invoice, String platformCode, Integer status, String startDate, String endDate, Integer type);

    void transferRevoke(String businessNo);
}
